package com.example.fist.entity;

import javax.persistence.*;

import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "details", schema = "competition", catalog = "")
public class DetailsEntity {
    private int deId;
    private Integer coId;
    private Integer comId;
    private String title;
    private String mode;
    private String enrollTime;
    private String startTime;
    private String releaseTime;
    private String contacts;
    private int phone;
    private String content;
    private Date modifiTime;
    private Date delTime;
    private String modifiName;
    private int isvisible;
    private String note;
    private String state;

    @Id
    @Column(name = "de_id", nullable = false)
    public int getDeId() {
        return deId;
    }

    public void setDeId(int deId) {
        this.deId = deId;
    }

    @Basic
    @Column(name = "co_id", nullable = true)
    public Integer getCoId() {
        return coId;
    }

    public void setCoId(Integer coId) {
        this.coId = coId;
    }

    @Basic
    @Column(name = "com_id", nullable = true)
    public Integer getComId() {
        return comId;
    }

    public void setComId(Integer comId) {
        this.comId = comId;
    }

    @Basic
    @Column(name = "title", nullable = false, length = 20)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "mode", nullable = false, length = 10)
    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    @Basic
    @Column(name = "enroll_time", nullable = false, length = 50)
    public String getEnrollTime() {
        return enrollTime;
    }

    public void setEnrollTime(String enrollTime) {
        this.enrollTime = enrollTime;
    }

    @Basic
    @Column(name = "start_time", nullable = false, length = 50)
    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "release_time", nullable = false, length = 50)
    public String getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(String releaseTime) {
        this.releaseTime = releaseTime;
    }

    @Basic
    @Column(name = "contacts", nullable = false, length = 50)
    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    @Basic
    @Column(name = "phone", nullable = false)
    public int getPhone() {
        return phone;
    }

    public void setPhone(int phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "content", nullable = false, length = -1)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "modifi_time", nullable = false)
    public Date getModifiTime() {
        return modifiTime;
    }

    public void setModifiTime(Date modifiTime) {
        this.modifiTime = modifiTime;
    }

    @Basic
    @Column(name = "del_time", nullable = false)
    public Date getDelTime() {
        return delTime;
    }

    public void setDelTime(Date delTime) {
        this.delTime = delTime;
    }

    @Basic
    @Column(name = "modifi_name", nullable = false, length = 10)
    public String getModifiName() {
        return modifiName;
    }

    public void setModifiName(String modifiName) {
        this.modifiName = modifiName;
    }

    @Basic
    @Column(name = "isvisible", nullable = false)
    public int getIsvisible() {
        return isvisible;
    }

    public void setIsvisible(int isvisible) {
        this.isvisible = isvisible;
    }

    @Basic
    @Column(name = "note", nullable = false, length = -1)
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Basic
    @Column(name = "state", nullable = false, length = 10)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DetailsEntity that = (DetailsEntity) o;
        return deId == that.deId &&
                phone == that.phone &&
                isvisible == that.isvisible &&
                Objects.equals(coId, that.coId) &&
                Objects.equals(comId, that.comId) &&
                Objects.equals(title, that.title) &&
                Objects.equals(mode, that.mode) &&
                Objects.equals(enrollTime, that.enrollTime) &&
                Objects.equals(startTime, that.startTime) &&
                Objects.equals(releaseTime, that.releaseTime) &&
                Objects.equals(contacts, that.contacts) &&
                Objects.equals(content, that.content) &&
                Objects.equals(modifiTime, that.modifiTime) &&
                Objects.equals(delTime, that.delTime) &&
                Objects.equals(modifiName, that.modifiName) &&
                Objects.equals(note, that.note) &&
                Objects.equals(state, that.state);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deId, coId, comId, title, mode, enrollTime, startTime, releaseTime, contacts, phone, content, modifiTime, delTime, modifiName, isvisible, note, state);
    }
}
